home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Menu / c / PopUp < prev    next >
Text File  |  1995-07-08  |  1KB  |  36 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Menu.PopUp.c
  12.     Author:  Copyright © 1994 Tony Houghton
  13.     Version: 1.00 (25 Sep 1994)
  14.     Purpose: Pop up a menu to the right of a button icon.
  15. */
  16.  
  17. #include "DeskLib:Menu.h"
  18. #include "DeskLib:WimpSWIs.h"
  19. #include "DeskLib:Coord.h"
  20.  
  21.  
  22. void Menu_PopUp(menu_ptr menu,window_handle window,icon_handle icon)
  23. {
  24.   window_state wstate;
  25.   icon_block istate;
  26.  
  27.   /* Find position of icon on screen */
  28.   Wimp_GetWindowState(window,&wstate);
  29.   Wimp_GetIconState(window,icon,&istate);
  30.   Coord_PointToScreen(&istate.workarearect.max,
  31.                       (convert_block *) &wstate.openblock.screenrect);
  32.  
  33.   /* Open menu here (Menu_Show subtracts 64 from X xoord) */
  34.   Menu_Show(menu,istate.workarearect.max.x+64,istate.workarearect.max.y);
  35. }
  36.